package com.hmall.item.controller;

import com.hmall.item.domain.dto.DateTimeDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.time.LocalDateTime;

/*********************************************************
 ** helloController
 ** <br><br>
 ** @ClassName: HelloController
 ** @author: yangfeng
 ** @date: 2024/12/16 14:47
 ** @version: 1.0.0
 *********************************************************/
@RestController
@Slf4j
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/getCurrentTime")
    public DateTimeDTO getCurrentTime(){
        return new DateTimeDTO(LocalDateTime.now());
    }
    @GetMapping("/getUrlLocalDate/{date}")
    public String getUrlLocalDate(@PathVariable LocalDate date){
        log.info("date = {}",date);
        return "ok";
    }

    @GetMapping("/getUrlLocalDateTime/{time}")
    public String getUrlLocalDatetime(@PathVariable LocalDateTime time){
        log.info("time = {}",time);
        return "ok";
    }

}
